import HotSaleData from "./HotSaleData";

export default class HotSaleRow {
  cateRankId: number;
  itemId: number;
  itemTitle: string;
  pictUrl: string;
  detailUrl: string;
  shopId: number;
  shopTitle: string;
  shopUrl: string;
  tradeGrowthRange: number;
  payRateIndex: number;
  tradeIndex: number;

  constructor(data: HotSaleData) {
    this.cateRankId = data.cateRankId.value;
    this.itemId = data.itemId.value;
    this.itemTitle = data.item.title;
    this.pictUrl = data.item.pictUrl;
    this.detailUrl = data.item.detailUrl;
    this.shopId = data.shop.userId;
    this.shopTitle = data.shop.title;
    this.shopUrl = data.shop.shopUrl;
    this.tradeGrowthRange = data.tradeGrowthRange.value;
    this.payRateIndex = data.payRateIndex.value;
    this.tradeIndex = data.tradeIndex.value;
  }
}
